/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sistema_comercial.dominio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Fabio
 */
@Entity
@Table(name = "comtb_moeda")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Moeda.findAll", query = "SELECT m FROM Moeda m"),
    @NamedQuery(name = "Moeda.findByInCodigomoeda", query = "SELECT m FROM Moeda m WHERE m.inCodigomoeda = :inCodigomoeda"),
    @NamedQuery(name = "Moeda.findByChDescricaomoeda", query = "SELECT m FROM Moeda m WHERE m.chDescricaomoeda = :chDescricaomoeda")})
public class Moeda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "IN_CODIGOMOEDA")
    private Long inCodigomoeda;
    @Size(max = 15)
    @Column(name = "CH_DESCRICAOMOEDA")
    private String chDescricaomoeda;

    public Moeda() {
    }

    public Moeda(Long inCodigomoeda) {
        this.inCodigomoeda = inCodigomoeda;
    }

    public Long getInCodigomoeda() {
        return inCodigomoeda;
    }

    public void setInCodigomoeda(Long inCodigomoeda) {
        this.inCodigomoeda = inCodigomoeda;
    }

    public String getChDescricaomoeda() {
        return chDescricaomoeda;
    }

    public void setChDescricaomoeda(String chDescricaomoeda) {
        this.chDescricaomoeda = chDescricaomoeda;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (inCodigomoeda != null ? inCodigomoeda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Moeda)) {
            return false;
        }
        Moeda other = (Moeda) object;
        if ((this.inCodigomoeda == null && other.inCodigomoeda != null) || (this.inCodigomoeda != null && !this.inCodigomoeda.equals(other.inCodigomoeda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.sistema_comercial.dominio.Moeda[ inCodigomoeda=" + inCodigomoeda + " ]";
    }
    
}
